package pres.lnk.learn.designpattern.a_factory;

import pres.lnk.learn.designpattern.a_factory.impl.Mysql;
import pres.lnk.learn.designpattern.a_factory.impl.Oracle;

/**
 * 数据库工厂
 *
 * @Author lnk
 * @Date 2018/1/31
 */
public class DatabaseFactory {

    public Database getShape(String type) {
        if ("Mysql".equalsIgnoreCase(type)) {
            return new Mysql();
        } else if ("Oracle".equalsIgnoreCase(type)) {
            return new Oracle();
        }

        return null;
    }
}
